/*
 * Copyright (c) 2006 - 2022, webrx.cn All rights reserved.
 *
 */
package cn;

/**
 * <p>Project: app2022 - StringBuilder2
 * <p>Powered by webrx On 2022-01-12 17:51:21
 *
* @author webrx [webrx@126.com]
 * @version 1.0
 * @since 17
 */
public class StringBuilder2 {
    public static void main(String[] args) {
        //字符串逆序
        String str = "学习Java程序设计";
        System.out.println(str);
        System.out.println(new StringBuilder(str).reverse());

        String ns = "";
        for(int i=0;i<str.length();i++){
            ns = str.substring(i,i+1) + ns;
        }
        System.out.println(ns);

        StringBuilder sbu = new StringBuilder(40);
        sbu.append("hello23424234234");
        System.out.println(sbu.length());
        System.out.println(sbu.capacity());
    }
}
